/**
 * tjftp -- A simple FTP server, using the ANSI C
 * Copyright (C) 2011  degui.chen <degui.chen@qq.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "cmd.h"
#include "../sesstion.h"
int tj_cmd_pwd(int accept_fd, char* request, char* response) {
	request = request + strlen("PWD ");
	tj_string_trim(request);
	PSesstion sesstion = tj_sesstion_get(accept_fd);
	char pwd[255] = { '\0' };
	sprintf(response, "257 \"%s\" is current directory.", sesstion->pwd);
	return strlen(response);
}
